package com.scy.java.object;

public class Rect {
    public void methon(){
        //打印10*8的*型矩形
        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 8; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
    //打印并计算*型矩形面积
//    方法的重载，方法名相同(参数列表不同)
//    public void methon()
//    public void methon(int m , int n)
    public void methon(int m , int n){
        methon();
        //打印m*n的*型矩形,计算并返回矩形的面积
        for (int i  = 0; i < m; i++) {
            for (int j = 0; j < n; j++) {
                System.out.print("*");
            }
            System.out.println();
        }

    }
    public int methon2(int m, int n){
        methon(m,n);
        return m*n;
    }

}
